#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const int N = 1e6 + 10, INF = 0x3f3f3f3f;

int n;
int id[N], cnt[N];
vector<string> a;
string b;
int tr[N][26], fail[N], ed[N], idx;


int insert(string& s)
{
    int p = 0;
    for (char it : s) {
        int c = it - 'a';
        if (tr[p][c] == 0) tr[p][c] = ++idx;
        p = tr[p][c];
    }
    ed[p]++;
    return p;
}

void setfail()
{
    queue<int> q;
    for (int i = 0;i < 26;i++) if (tr[0][i])  q.push(tr[0][i]);
    while (!q.empty()) {
        int now = q.front(); q.pop();
        for (int i = 0;i < 26;i++)
            if (tr[now][i]) {
                fail[tr[now][i]] = tr[fail[now]][i];
                q.push(tr[now][i]);
            } else tr[now][i] = tr[fail[now]][i];
    }
}

void solve()
{
    cin >> n;
    for (int i = 1;i <= n;i++) {
        string c;cin >> c;
        a.push_back(c);
        id[i] = insert(c);
    }
    setfail();
    cin >> b;

    int p = 0;
    for (char c : b) {
        p = tr[p][c - 'a'];
        int tmp = p;
        while (tmp && cnt[tmp] == 0) {
            cnt[tmp] = 1;
            tmp = fail[tmp];
        }
    }

    int ans = 0;
    for (int i = 1;i <= n;i++) if (cnt[id[i]]) ans++;
    cout << ans << '\n';
}

signed main()
{
    //ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    int T = 1;
    //cin>>T;
    for (int i = 1;i <= T;i++) {
        solve();
    }
}